3.13 \(\int \frac{d+e x+f x^2+g x^3+h x^4}{4-5 x^2+x^4} \, dx\)

Optimal. Leaf size=64 \[ -\frac{1}{6} \tanh ^{-1}\left (\frac{x}{2}\right ) (d+4 f+16 h)+\frac{1}{3} \tanh ^{-1}(x) (d+f+h)-\frac{1}{6} (e+g) \log \left (1-x^2\right )+\frac{1}{6} (e+4 g) \log \left (4-x^2\right )+h x \]

[Out]

h*x - ((d + 4*f + 16*h)*ArcTanh[x/2])/6 + ((d + f + h)*ArcTanh[x])/3 - ((e + g)*
Log[1 - x^2])/6 + ((e + 4*g)*Log[4 - x^2])/6

_______________________________________________________________________________________

Rubi [A]  time = 0.315363, antiderivative size = 64, normalized size of antiderivative = 1., number of steps used = 10, number of rules used = 7, integrand size = 33, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.212 \[ -\frac{1}{6} \tanh ^{-1}\left (\frac{x}{2}\right ) (d+4 f+16 h)+\frac{1}{3} \tanh ^{-1}(x) (d+f+h)-\frac{1}{6} (e+g) \log \left (1-x^2\right )+\frac{1}{6} (e+4 g) \log \left (4-x^2\right )+h x \]

Antiderivative was successfully verified.

[In]  Int[(d + e*x + f*x^2 + g*x^3 + h*x^4)/(4 - 5*x^2 + x^4),x]

[Out]

h*x - ((d + 4*f + 16*h)*ArcTanh[x/2])/6 + ((d + f + h)*ArcTanh[x])/3 - ((e + g)*
Log[1 - x^2])/6 + ((e + 4*g)*Log[4 - x^2])/6

_______________________________________________________________________________________

Rubi in Sympy [F]  time = 0., size = 0, normalized size = 0. \[ - \left (\frac{e}{6} + \frac{g}{6}\right ) \log{\left (- x^{2} + 1 \right )} + \left (\frac{e}{6} + \frac{2 g}{3}\right ) \log{\left (- x^{2} + 4 \right )} - \left (\frac{d}{6} + \frac{2 f}{3} + \frac{8 h}{3}\right ) \operatorname{atanh}{\left (\frac{x}{2} \right )} + \left (\frac{d}{3} + \frac{f}{3} + \frac{h}{3}\right ) \operatorname{atanh}{\left (x \right )} + \int h\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((h*x**4+g*x**3+f*x**2+e*x+d)/(x**4-5*x**2+4),x)

[Out]

-(e/6 + g/6)*log(-x**2 + 1) + (e/6 + 2*g/3)*log(-x**2 + 4) - (d/6 + 2*f/3 + 8*h/
3)*atanh(x/2) + (d/3 + f/3 + h/3)*atanh(x) + Integral(h, x)

_______________________________________________________________________________________

Mathematica [A]  time = 0.0879934, size = 81, normalized size = 1.27 \[ \frac{1}{12} (-2 \log (1-x) (d+e+f+g+h)+\log (2-x) (d+2 (e+2 f+4 g+8 h))+2 \log (x+1) (d-e+f-g+h)-\log (x+2) (d-2 e+4 f-8 g+16 h)+12 h x) \]

Antiderivative was successfully verified.

[In]  Integrate[(d + e*x + f*x^2 + g*x^3 + h*x^4)/(4 - 5*x^2 + x^4),x]

[Out]

(12*h*x - 2*(d + e + f + g + h)*Log[1 - x] + (d + 2*(e + 2*f + 4*g + 8*h))*Log[2
 - x] + 2*(d - e + f - g + h)*Log[1 + x] - (d - 2*e + 4*f - 8*g + 16*h)*Log[2 +
x])/12

_______________________________________________________________________________________

Maple [B]  time = 0.014, size = 145, normalized size = 2.3 \[ hx-{\frac{\ln \left ( 2+x \right ) d}{12}}+{\frac{\ln \left ( 2+x \right ) e}{6}}-{\frac{\ln \left ( 2+x \right ) f}{3}}+{\frac{2\,\ln \left ( 2+x \right ) g}{3}}-{\frac{4\,\ln \left ( 2+x \right ) h}{3}}-{\frac{\ln \left ( -1+x \right ) d}{6}}-{\frac{\ln \left ( -1+x \right ) e}{6}}-{\frac{\ln \left ( -1+x \right ) f}{6}}-{\frac{\ln \left ( -1+x \right ) g}{6}}-{\frac{\ln \left ( -1+x \right ) h}{6}}+{\frac{\ln \left ( 1+x \right ) d}{6}}-{\frac{\ln \left ( 1+x \right ) e}{6}}+{\frac{\ln \left ( 1+x \right ) f}{6}}-{\frac{\ln \left ( 1+x \right ) g}{6}}+{\frac{\ln \left ( 1+x \right ) h}{6}}+{\frac{\ln \left ( x-2 \right ) d}{12}}+{\frac{\ln \left ( x-2 \right ) e}{6}}+{\frac{\ln \left ( x-2 \right ) f}{3}}+{\frac{2\,\ln \left ( x-2 \right ) g}{3}}+{\frac{4\,\ln \left ( x-2 \right ) h}{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((h*x^4+g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x)

[Out]

h*x-1/12*ln(2+x)*d+1/6*ln(2+x)*e-1/3*ln(2+x)*f+2/3*ln(2+x)*g-4/3*ln(2+x)*h-1/6*l
n(-1+x)*d-1/6*ln(-1+x)*e-1/6*ln(-1+x)*f-1/6*ln(-1+x)*g-1/6*ln(-1+x)*h+1/6*ln(1+x
)*d-1/6*ln(1+x)*e+1/6*ln(1+x)*f-1/6*ln(1+x)*g+1/6*ln(1+x)*h+1/12*ln(x-2)*d+1/6*l
n(x-2)*e+1/3*ln(x-2)*f+2/3*ln(x-2)*g+4/3*ln(x-2)*h

_______________________________________________________________________________________

Maxima [A]  time = 0.704997, size = 97, normalized size = 1.52 \[ h x - \frac{1}{12} \,{\left (d - 2 \, e + 4 \, f - 8 \, g + 16 \, h\right )} \log \left (x + 2\right ) + \frac{1}{6} \,{\left (d - e + f - g + h\right )} \log \left (x + 1\right ) - \frac{1}{6} \,{\left (d + e + f + g + h\right )} \log \left (x - 1\right ) + \frac{1}{12} \,{\left (d + 2 \, e + 4 \, f + 8 \, g + 16 \, h\right )} \log \left (x - 2\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((h*x^4 + g*x^3 + f*x^2 + e*x + d)/(x^4 - 5*x^2 + 4),x, algorithm="maxima")

[Out]

h*x - 1/12*(d - 2*e + 4*f - 8*g + 16*h)*log(x + 2) + 1/6*(d - e + f - g + h)*log
(x + 1) - 1/6*(d + e + f + g + h)*log(x - 1) + 1/12*(d + 2*e + 4*f + 8*g + 16*h)
*log(x - 2)

_______________________________________________________________________________________

Fricas [A]  time = 1.51834, size = 97, normalized size = 1.52 \[ h x - \frac{1}{12} \,{\left (d - 2 \, e + 4 \, f - 8 \, g + 16 \, h\right )} \log \left (x + 2\right ) + \frac{1}{6} \,{\left (d - e + f - g + h\right )} \log \left (x + 1\right ) - \frac{1}{6} \,{\left (d + e + f + g + h\right )} \log \left (x - 1\right ) + \frac{1}{12} \,{\left (d + 2 \, e + 4 \, f + 8 \, g + 16 \, h\right )} \log \left (x - 2\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((h*x^4 + g*x^3 + f*x^2 + e*x + d)/(x^4 - 5*x^2 + 4),x, algorithm="fricas")

[Out]

h*x - 1/12*(d - 2*e + 4*f - 8*g + 16*h)*log(x + 2) + 1/6*(d - e + f - g + h)*log
(x + 1) - 1/6*(d + e + f + g + h)*log(x - 1) + 1/12*(d + 2*e + 4*f + 8*g + 16*h)
*log(x - 2)

_______________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((h*x**4+g*x**3+f*x**2+e*x+d)/(x**4-5*x**2+4),x)

[Out]

Timed out

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.297523, size = 108, normalized size = 1.69 \[ h x - \frac{1}{12} \,{\left (d + 4 \, f - 8 \, g + 16 \, h - 2 \, e\right )}{\rm ln}\left ({\left | x + 2 \right |}\right ) + \frac{1}{6} \,{\left (d + f - g + h - e\right )}{\rm ln}\left ({\left | x + 1 \right |}\right ) - \frac{1}{6} \,{\left (d + f + g + h + e\right )}{\rm ln}\left ({\left | x - 1 \right |}\right ) + \frac{1}{12} \,{\left (d + 4 \, f + 8 \, g + 16 \, h + 2 \, e\right )}{\rm ln}\left ({\left | x - 2 \right |}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((h*x^4 + g*x^3 + f*x^2 + e*x + d)/(x^4 - 5*x^2 + 4),x, algorithm="giac")

[Out]

h*x - 1/12*(d + 4*f - 8*g + 16*h - 2*e)*ln(abs(x + 2)) + 1/6*(d + f - g + h - e)
*ln(abs(x + 1)) - 1/6*(d + f + g + h + e)*ln(abs(x - 1)) + 1/12*(d + 4*f + 8*g +
 16*h + 2*e)*ln(abs(x - 2))